package com.itheima_16;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class CallNameDemo {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("/Users/oscar/Desktop/HQWork/学习资料/code/mySimpleDateFormat/Name.txt"));

        ArrayList<String> arrayList = new ArrayList<String>();

        String line;
        while ((line = br.readLine()) != null) {
            arrayList.add(line);
        }

        Random random = new Random();
        int i = random.nextInt(arrayList.size());

        String s = arrayList.get(i);
        System.out.println("幸运者是：" + s);
    }
}
